import { createVNode } from 'vue'
import ImageView from './ImageView.vue'

const ImageView = (options) => {
  const Destory = () => {
    render(null, container)
  }

  const container = document.createElement('div')
  const props = { ...options, Destory }
  const vm = createVNode(ImageView, props)

  render(vm, container)
  document.body.appendChild(container.firstElementChild)
}

const useImageView = () => {
  return {
    ImageView
  }
}

export { ImageView, useImageView }
export default ImageView
